package logic

import (
	"context"
	"gitee.com/unitedrhino/protocol-wumei/service/pwumeisvr/internal/svc"
	"gitee.com/unitedrhino/share/errors"
	"gitee.com/unitedrhino/things/service/dmsvr/pb/dm"
)

func GetProductInfo(ctx context.Context, svcCtx *svc.ServiceContext, id string) (*dm.ProductInfo, error) {
	productID := id
	if productID == "" {
		return nil, errors.NotFind.AddMsg("产品未找到")
	}
	pi, err := svcCtx.Protocol.ProductCache.GetData(ctx, productID)
	return pi, err
}

func GetProductID(svcCtx *svc.ServiceContext, id string) string {
	return id
}
